package main

import "fmt"

func main()  {
  c:=make(chan int)
  quit :=make(chan int)

  go func() {
	  for i:=0;i<10 ;i++  {
	  	fmt.Println(<-c)
	  }
	  quit <- 0
	  //close(c)
  }()
	aa(c,quit)
	//for data := range  c  {
    // fmt.Println(data)
	//}


}
func aa(c,quit chan int){
	x,y:=1,1
	for {
		select {
		case c<-x:
			x=y
			y=x+y
		case <- quit:
			fmt.Println("quit")
			return
		}
	}

}

